@echo off
echo Starting Snake Game with GPU/CPU auto-detection...
echo.

REM Set basic JVM options for better performance
set MAVEN_OPTS=-Xmx8g -Xms2g -Dorg.bytedeco.javacpp.maxbytes=8G

echo MAVEN_OPTS: %MAVEN_OPTS%
echo.

REM Check if Maven is available
where mvn >nul 2>&1
if %errorlevel% neq 0 (
    echo ERROR: Maven (mvn) not found in PATH
    echo Please install Maven or add it to your PATH
    pause
    exit /b 1
)

REM Compile and run
echo Compiling project...
mvn compile -q
if %errorlevel% neq 0 (
    echo Compilation failed!
    pause
    exit /b 1
)

echo Starting game...
mvn exec:java -Dexec.mainClass="org.dxy.trigger.SnakeGameWithDQN" -q

pause